/*
 * @Author: your name
 * @Date: 2021-09-25 10:40:01
 * @LastEditTime: 2021-10-07 11:35:28
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \backEnd\routes\test.js
 */
// 引入路由模块
const { Router } = require('express')
// 创建一个路由实例
const router = new Router()

const userImformationModel = require('../model/userImformation')

const {addOneDoc} = require('../utils/DB/controlDB')

const url = require('../config/url')

router.get('/test',(req, res)=> {
    const docObJ = {
        model: userImformationModel,
        option: {
            count: '20194423347',
            email: '123456789@qq.com',
            password: '123456',
            nickname:'故事里的人',
            signature: '',
            imgUrl: url + 'public/free/userPic/test.jpg'
        },
        attachOption: {},
        callback: function (data) {
            // req.session[data._id] = data._id
            // data.data = data.data._id
            res.json(data)
        }
    }
    addOneDoc(docObJ)
    // const data = {
    //     code: '200',
    //     data: {
    //         a:'xax'
    //     }
    // }
    // res.send(JSON.stringify(data))
})

module.exports = router
